﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T09_类与构造函数
{
    class Account
    {
        private decimal money;
        private string name;
        public Account()//无参构造函数
        {
            money = 0;
            name = " ";
        }
        public Account(string id,decimal money)//局部变量，用this的方法引用，有参数的构造函数
            {
            this.name = id;
            this.money = money;
            }
        public override string ToString()//重写ToString函数，注意关键字
        {
            return string.Format("用户：{0},余额：{1}", name, money);
        }
    }
}
